import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import About from "../views/About.vue";
import qiandaoo from "../components/qiandaoo.vue";
import choujiang from "../components/choujiang.vue";
import fuli from "../components/fuli.vue";
import shouhuo from "../components/shouhuo.vue";
import jiangli from "../components/jiangli.vue";
import daoju from "../components/daoju.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/a",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: About,
    redirect:'/a/a',
    children: [
      { path: "/a/a", component: qiandaoo },
      { path: "/a/b", component: choujiang },
      { path: "/a/c", component: fuli },
      {
        path: "/a/d",
        component: shouhuo,
        redirect:'/a/d/a',
        children: [
          { path: "/a/d/a", component: jiangli },
          { path: "/a/d/b", component: daoju },
        ],
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
